function findLevel2(obj){
	//获得一级分类的id
	var level1Id = $(obj).val();
	//发送异步请求
	$.ajax({
		url:"/ssm_app/devApp/findLevelJson",
		data:"{\"levelId\":\""+level1Id+"\"}",
		type:"post",
		datatype:"json",
		success:function(data){
			var content = "<option value=''>-- 请选择 --</option>";
			//选中三级分类的下拉列表
			var level3 = $("#appLevelThree");
			level3.html(content);
			//选中二级分类的下拉列表
			var level2 = $("#appLevelTwo");
			//解析拼接json
			for(var i = 0;i < data.length;i++){
				content += "<option value='"+data[i].id+"'>"+data[i].categoryname+"</option>";
			}
			level2.html(content);
		},
		contentType:"application/json;charset=utf-8"
	});
}


function findLevel3(obj){
	//获得一级分类的id
	var level2Id = $(obj).val();
	//发送异步请求
	$.ajax({
		url:"/ssm_app/devApp/findLevelJson",
		data:"{\"levelId\":\""+level2Id+"\"}",
		type:"post",
		datatype:"json",
		success:function(data){
			//选中三级分类的下拉列表
			var level3 = $("#appLevelThree");
			var content = "<option value=''>-- 请选择 --</option>";
			for(var i = 0;i < data.length;i++){
				content += "<option value='"+data[i].id+"'>"+data[i].categoryname+"</option>";
			}
			level3.html(content);
		},
		contentType:"application/json;charset=utf-8"
	});
}



//分页
function page(num){
	//2
	//动态修改id为currentPage的隐藏input
	$("#currentPage").val(num);
	//提交表单,
	$("#demo-form2").submit();
}

//异步校验APK名称
function checkAPKName(obj){
	//获取到APK名称
	var apkName = $(obj).val();
	//异步校验
	$.ajax({
		url:"/ssm_app/devApp/checkAPKName",
		data:"{\"apkName\":\""+apkName+"\"}",
		type:"post",
		datatype:"json",
		success:function(data){
			//
			$("#apkNameInfo").html(data.apkNameInfo);
			$("#apkNameInfo").css("color","red");
		},
		contentType:"application/json;charset=utf-8"
	});
}


//跳转修改页面
function appInfoUpdate(obj){
	//接收状态信息
	var status = $(obj).attr("appInfoStatus");
	if(!(status == 1 || status == 3)){
		alert("只有状态为未审核和审核未通过的app才可以进行修改");
		return ;
	}
	//获得当前app信息的id
	var id = $(obj).attr("appInfoId");
	location.href = "/ssm_app/devApp/disAppInfoUpdate/"+id;
	
}


//修改图片
function changeImg(obj){
	$("#picImg").css("display","none");
	$(obj).css("display","none");
	$("#picFile").css("display","block");
}


function shoppingCart(){
	//接收状态信息
	
	location.href = "/ssm_app/DevAppCommodityPurchase/shoppingCart";
	
}
//隐藏于 显示..
$('#dianji').hover(function(){
	console.log(1);
	$('#div1').hide();
	
})
	






